home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / cmds.fmt / imake.man < prev    next >
Encoding:
Text File  |  1991-10-30  |  9.6 KB  |  265 lines

  1.  
  2.  
  3.  
  4. IMAKE                     User Commands                     IMAKE
  5.  
  6.  
  7.  
  8. NNAAMMEE
  9.      imake - C preprocessor interface to the make utility
  10.  
  11. SSYYNNOOPPSSIISS
  12.      iimmaakkee [ --DD_d_e_f_i_n_e ] [ --II_d_i_r ] [ --TT_t_e_m_p_l_a_t_e ] [ --ff _f_i_l_e_n_a_m_e ]
  13.      [ --ss _f_i_l_e_n_a_m_e ] [ --ee ] [ --vv ]
  14.  
  15. DDEESSCCRRIIPPTTIIOONN
  16.      _I_m_a_k_e is used to generate _M_a_k_e_f_i_l_e_s from a template, a set
  17.      of _c_p_p macro functions, and a per-directory input file
  18.      called an _I_m_a_k_e_f_i_l_e.  This allows machine dependencies (such
  19.      has compiler options, alternate command names, and special
  20.      _m_a_k_e rules) to be kept separate from the descriptions of the
  21.      various items to be built.
  22.  
  23. OOPPTTIIOONNSS
  24.      The following command line options may be passed to _i_m_a_k_e:
  25.  
  26.      --DD_d_e_f_i_n_e
  27.              This option is passed directly to _c_p_p.  It is typi-
  28.              cally used to set directory-specific variables.  For
  29.              example, the X Window System uses this flag to set
  30.              _T_O_P_D_I_R to the name of the directory containing the
  31.              top of the core distribution and _C_U_R_D_I_R to the name
  32.              of the current directory, relative to the top.
  33.  
  34.      --II_d_i_r_e_c_t_o_r_y
  35.              This option is passed directly to _c_p_p.  It is typi-
  36.              cally used to indicate the directory in which the
  37.              _i_m_a_k_e template and configuration files may be found.
  38.  
  39.      --TT_t_e_m_p_l_a_t_e
  40.              This option specifies the name of the master tem-
  41.              plate file (which is usually located in the direc-
  42.              tory specified with -_I) used by _c_p_p.  The default is
  43.              _I_m_a_k_e._t_m_p_l.
  44.  
  45.      --ff _f_i_l_e_n_a_m_e
  46.              This option specifies the name of the per-directory
  47.              input file.  The default is _I_m_a_k_e_f_i_l_e.
  48.  
  49.      --ss _f_i_l_e_n_a_m_e
  50.              This option specifies the name of the _m_a_k_e descrip-
  51.              tion file to be generated but _m_a_k_e should not be
  52.              invoked.  If the _f_i_l_e_n_a_m_e is a dash (-), the output
  53.              is written to _s_t_d_o_u_t.  The default is to generate,
  54.              but not execute, a _M_a_k_e_f_i_l_e.
  55.  
  56.      --ee      This option indicates the _i_m_a_k_e should execute the
  57.              generated _M_a_k_e_f_i_l_e.  The default is to leave this to
  58.              the user.
  59.  
  60.  
  61.  
  62.  
  63. X Version 11                Release 5                           1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. IMAKE                     User Commands                     IMAKE
  71.  
  72.  
  73.  
  74.      --vv      This option indicates that _i_m_a_k_e should print the
  75.              _c_p_p command line that it is using to generate the
  76.              _M_a_k_e_f_i_l_e.
  77.  
  78. HHOOWW IITT WWOORRKKSS
  79.      _I_m_a_k_e invokes _c_p_p with any -_I or -_D flags passed on the com-
  80.      mand line and passes it the following 3 lines:
  81.  
  82.                #define IMAKE_TEMPLATE "Imake.tmpl"
  83.                #define INCLUDE_IMAKEFILE "Imakefile"
  84.                #include IMAKE_TEMPLATE
  85.  
  86.      where _I_m_a_k_e._t_m_p_l and _I_m_a_k_e_f_i_l_e may be overridden by the -_T
  87.      and -_f command options, respectively.
  88.  
  89.      The IMAKE_TEMPLATE typically reads in a file containing
  90.      machine-dependent parameters (specified as _c_p_p symbols), a
  91.      site-specific parameters file, a file defining variables, a
  92.      file containing _c_p_p macro functions for generating _m_a_k_e
  93.      rules, and finally the _I_m_a_k_e_f_i_l_e (specified by
  94.      INCLUDE_IMAKEFILE) in the current directory.  The _I_m_a_k_e_f_i_l_e
  95.      uses the macro functions to indicate what targets should be
  96.      built; _i_m_a_k_e takes care of generating the appropriate rules.
  97.  
  98.      _I_m_a_k_e configuration files contain two types of variables,
  99.      imake variables and make variables.  The imake variables are
  100.      interpreted by cpp when _i_m_a_k_e is run.  By convention they
  101.      are mixed case.  The make variables are written into the
  102.      _M_a_k_e_f_i_l_e for later interpretation by _m_a_k_e. By convention
  103.      make variables are upper case.
  104.  
  105.      The rules file (usually named _I_m_a_k_e._r_u_l_e_s in the configura-
  106.      tion directory) contains a variety of _c_p_p macro functions
  107.      that are configured according to the current platform.
  108.      _I_m_a_k_e replaces any occurrences of the string ``@@'' with a
  109.      newline to allow macros that generate more than one line of
  110.      _m_a_k_e rules. For example, the macro
  111.  
  112.      #define   program_target(program, objlist)        @@\
  113.      program:  objlist                                 @@\
  114.                $(CC)  -o  $@  objlist  $(LDFLAGS)
  115.  
  116.      when called with _p_r_o_g_r_a_m__t_a_r_g_e_t(_f_o_o, _f_o_o_1._o  _f_o_o_2._o) will
  117.      expand to
  118.  
  119.      foo:      foo1.o  foo2.o
  120.                $(CC)  -o  $@  foo1.o  foo2.o  $(LDFLAGS)
  121.  
  122.  
  123.      On systems whose _c_p_p reduces multiple tabs and spaces to a
  124.      single space, _i_m_a_k_e attempts to put back any necessary tabs
  125.      (_m_a_k_e is very picky about the difference between tabs and
  126.  
  127.  
  128.  
  129. X Version 11                Release 5                           2
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. IMAKE                     User Commands                     IMAKE
  137.  
  138.  
  139.  
  140.      spaces).  For this reason, colons (:) in command lines must
  141.      be preceded by a backslash (\).
  142.  
  143. UUSSEE WWIITTHH TTHHEE XX WWIINNDDOOWW SSYYSSTTEEMM
  144.      The X Window System uses _i_m_a_k_e extensively, for both full
  145.      builds within the source tree and external software.  As
  146.      mentioned above, two special variables, _T_O_P_D_I_R and _C_U_R_D_I_R,
  147.      are set to make referencing files using relative path names
  148.      easier.  For example, the following command is generated
  149.      automatically to build the _M_a_k_e_f_i_l_e in the directory _l_i_b/_X/
  150.      (relative to the top of the sources):
  151.  
  152.                %  ../.././config/imake  -I../.././config  \
  153.                      -DTOPDIR=../../.   -DCURDIR=./lib/X
  154.  
  155.      When building X programs outside the source tree, a special
  156.      symbol _U_s_e_I_n_s_t_a_l_l_e_d is defined and _T_O_P_D_I_R and _C_U_R_D_I_R are
  157.      omitted.  If the configuration files have been properly
  158.      installed, the script _x_m_k_m_f(1) may be used.
  159.  
  160. IINNPPUUTT FFIILLEESS
  161.      Here is a summary of the files read by _i_m_a_k_e as used by X.
  162.      The indentation shows what files include what other files.
  163.  
  164.          Imake.tmpl                generic variables
  165.              site.def              site-specific, BeforeVendorCF defined
  166.              *.cf                  machine-specific
  167.                  *Lib.rules        shared library rules
  168.              site.def              site-specific, AfterVendorCF defined
  169.              Project.tmpl          X-specific variables
  170.                  *Lib.tmpl         shared library variables
  171.              Imake.rules           rules
  172.          Imakefile
  173.              Library.tmpl          library rules
  174.              Server.tmpl           server rules
  175.  
  176.      Note that _s_i_t_e._d_e_f gets included twice, once before the *._c_f
  177.      file and once after.  Although most site customizations
  178.      should be specified after the *._c_f file, some, such as the
  179.      choice of compiler, need to be specified before, because
  180.      other variable settings may depend on them.
  181.  
  182.      The first time _s_i_t_e._d_e_f is included, the variable BeforeVen-
  183.      dorCF is defined, and the second time, the variable After-
  184.      VendorCF is defined.  All code in _s_i_t_e._d_e_f should be inside
  185.      an #ifdef for one of these symbols.
  186.  
  187. FFIILLEESS
  188.      /usr/tmp/tmp-imake._n_n_n_n_n_n     temporary input file for cpp
  189.      /usr/tmp/tmp-make._n_n_n_n_n_n      temporary input file for make
  190.      /lib/cpp                      default C preprocessor
  191.  
  192.  
  193.  
  194.  
  195. X Version 11                Release 5                           3
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. IMAKE                     User Commands                     IMAKE
  203.  
  204.  
  205.  
  206. SSEEEE AALLSSOO
  207.      make(1), xmkmf(1)
  208.      S. I. Feldman, _M_a_k_e - _A _P_r_o_g_r_a_m _f_o_r _M_a_i_n_t_a_i_n_i_n_g _C_o_m_p_u_t_e_r
  209.      _P_r_o_g_r_a_m_s
  210.  
  211. EENNVVIIRROONNMMEENNTT VVAARRIIAABBLLEESS
  212.      The following environment variables may be set, however
  213.      their use is not recommended as they introduce dependencies
  214.      that are not readily apparent when _i_m_a_k_e is run:
  215.  
  216.      IIMMAAKKEEIINNCCLLUUDDEE
  217.           If defined, this should be a valid include argument for
  218.           the C preprocessor.  E.g., ``-I/usr/include/local''.
  219.           Actually, any valid _c_p_p argument will work here.
  220.  
  221.      IIMMAAKKEECCPPPP
  222.           If defined, this should be a valid path to a preproces-
  223.           sor program.  E.g. ``/usr/local/cpp''.  By default,
  224.           _i_m_a_k_e will use /lib/cpp.
  225.  
  226.      IIMMAAKKEEMMAAKKEE
  227.           If defined, this should be a valid path to a make pro-
  228.           gram, such as ``/usr/local/make''.  By default, _i_m_a_k_e
  229.           will use whatever _m_a_k_e program is found using
  230.           _e_x_e_c_v_p(_3). This variable is only used if the ``-e''
  231.           option is specified.
  232.  
  233. AAUUTTHHOORR
  234.      Todd Brunhoff, Tektronix and MIT Project Athena; Jim Fulton,
  235.      MIT X Consortium
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261. X Version 11                Release 5                           4
  262.  
  263.  
  264.  
  265.